package mop.security.acl;

/**
 * Implementation of AssetInterface to keep in ACL registry
 * @author MOP Team 7
 */
public class Asset implements AssetInterface {
	
	/**
	 * Asset Id
	 */
	final String asset;

	/**
	 * Constructor
	 * @param asset	Asset id
	 * @post Asset id is set to given role
	 * 
	 */
	public Asset(String asset){
		this.asset = asset;
	}
	
	/**
	 * Return asset id
	 * @see AssetInterface#getAssetId()
	 */
	@Override
	public String getAssetId() {
		return this.asset;
	}
	
	/**
	 * @see Object#equals(Object)
	 * @param asset Other asset
	 * @return boolean
	 */
	public boolean equals(Object asset){
		if(!(asset instanceof AssetInterface))
			return false;
		return getAssetId().equals(((AssetInterface) asset).getAssetId());
	}

}
